#pragma once

#include <jlib/jlib.h>

USE_JLIB_NS


#define PREAMBLE 0xEB
#define PREAMBLE_2 0x9D


struct Pseudo {
  u32 srcIPv4;
  u32 dstIPv4;
  u8 reserved;
  u8 protocol;
  u16 datSize;
} __attribute__((packed));


struct IpPackage : public Obj {

  constexpr static uwl MAX_SIZE = 65536;

  List joint;
  ByteBuffer<> buf;
  std::string err;

  u32 srcIPv4;
  u32 dstIPv4;
  u16 srcPort;
  u16 dstPort;
  u16 hdrSize;
  u16 pkgSize;
  u8 protocol;
  u8 ttl;
  u8 tcpFlag {0};
};
